package com.metro.generator.gen.beans.constant;

import com.metro.generator.gen.GeneratorProperties;

import java.util.Properties;

/**
 * 代码生成器静态变量
 * Created by xk on 2018/1/29 0029.
 */
public class GenConstant {
    /**
     * 基础字段
     */
    public static final String GEN_PARAM_BASE_COLUMNS = "GEN_PARAM_BASE_COLUMNS";
    /**
     * 代码生成器模板路径
     */
    public static final String GEN_TEMPLATE_DIR = "GEN_TEMPLATE_DIR";

    /**
     * 代码生成器模板文件扩展名
     */
    public static final String[] GEN_FILE_EXT = new String[]{"java", "xml", "jsp", "txt"};

    /**
     * 默认编码
     */
    public static final String DEFAULT_ENCODING = "UTF-8";

    private static Properties props = GeneratorProperties.loadGeneratorProperties();

    /**
     * 获取代码生成器基础字段
     * @return
     */
    public static final String getBaseColumns(Properties props){
        return props.getProperty(GEN_PARAM_BASE_COLUMNS);
    }

    /**
     * 获取代码生成器模板路径
     * @return
     */
    public static final String getTemplateDir(){
        return props.getProperty(GEN_TEMPLATE_DIR);
    }
}
